<template>
	<div id="center">
		<div class="head">
			<p class="my-img"></p>
			<p class="name">关山月</p>
			<p class="tip-img"></p>
			<p class="set-img"></p>
			<ul class="centerList">
				<li @click="tojump(item)" v-for="item in centerList" :key="item.id">
					<p class="count">{{item.count}}</p>
					<p class="leixing">{{item.name}}</p>
				</li>
			</ul>
			<div class="vip">
				<input type="button" value="查看详情" />
			</div>
		</div>
		<div class="contentBox">
			<div class="order">
				<div class="commonhead">
					<span class="commonText">我的订单</span>
					<span class="lookall" @click="tojump2(lookall)">查看全部</span>
					<span class="rightImg"></span>
				</div>
				<ul class="orderList">
					<li @click="tojump(item)" v-for="item in orderList" :key="item.id">
						<p :class="item.class"></p>
						<p class="text">{{item.name}}</p>
					</li>
				</ul>

			</div>
			<div class="banner"></div>
			<div class="service">
				<div class="commonhead">
					<span class="commonText">我的订单</span>
					<span class="lookall" @click="tojump2">查看全部</span>
					<span class="rightImg"></span>
				</div>
				<ul class="serviceList">
					<li @click="tojump(item)" v-for="item in serviceList" :key="item.id">
						<p :class="item.class"></p>
						<p class="text">{{item.name}}</p>
					</li>
				</ul>
			</div>
		</div>
		<div class="like">
			<span class="img1"></span>
			<span class="text">猜你喜欢</span>
			<span class="img1"></span>
		</div>
	</div>
</template>

<script>
	export default {
		name: "center",
		data() {
			return {
				lookall: 'lookall',
				centerList: [{
						id: '1',
						name: "我的收藏",
						count: '12',
						path: 'shouchang'
					},
					{
						id: '2',
						name: "我的卡券",
						count: '2',
						path: 'card'
					},
					{
						id: '3',
						name: "我的积分",
						count: '300',
						path: 'jifen'
					},
					{
						id: '4',
						name: "我的浏览",
						count: '48',
						path: 'liulan'
					}
				],
				orderList: [{
						id: '1',
						name: "待付款",
						// path:require('../../assets/img/present.png'),
						class: 'pay',
						path: 'pay'
					},
					{
						id: '2',
						name: "待收货",
						// path:require('../../assets/img/present.png'),
						class: 'receiving',
						path: 'receiving'
					},
					{
						id: '3',
						name: "待评价",
						// path:require('../../assets/img/present.png'),
						class: 'evaluate',
						path: 'evaluate'
					},
					{
						id: '4',
						name: "售后/评价",
						// path:require('../../assets/img/present.png'),
						class: 'sales',
						path: 'comment'
					}
				],
				serviceList: [{
						id: '1',
						name: "收货地址",
						// path:require('../../assets/img/present.png'),
						class: 'address',
						path: 'address'
					},
					{
						id: '2',
						name: "我的零钱",
						// path:require('../../assets/img/present.png'),
						class: 'money',
						path: 'money'
					},
					{
						id: '3',
						name: "我的会员",
						// path:require('../../assets/img/present.png'),
						class: 'myvip',
						path: 'myvip'
					},
					{
						id: '4',
						name: "客服聊天",
						// path:require('../../assets/img/present.png'),
						class: 'chat',
						path: 'chat'
					},
					{
						id: '5',
						name: "任务中心",
						// path:require('../../assets/img/present.png'),
						class: 'task',
						path: 'task'
					},
					{
						id: '6',
						name: "用户协议",
						// path:require('../../assets/img/present.png'),
						class: 'agreement',
						path: 'agreement'
					},
					{
						id: '7',
						name: "常见问题",
						// path:require('../../assets/img/present.png'),
						class: 'question',
						path: 'question'
					},
					{
						id: '8',
						name: "产品建议",
						// path:require('../../assets/img/present.png'),
						class: 'proposal',
						path: 'proposal'
					}
				]
			}
		},
		methods: {
			tojump(item) {
				this.current = item.id;
				this.$router.push({
					path: `/${item.path}`,
				})
			},
			tojump2(lookall) {
				this.$router.push({
					path: `/${lookall}`,
				})
			},
		}

	}
</script>

<style scoped="scoped" lang="less">
	.bg {
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}

	.orderImg {
		display: inline-block;
		width: 0.32rem;
		height: 0.32rem;
		margin: 0 auto;
		margin-bottom: 0.04rem;
	}

	.serviceImg {
		display: inline-block;
		width: 0.28rem;
		height: 0.28rem;
		margin: 0 auto;
	}


	#center {
		background: #FAF8F8;

		.head {
			background-image: url(../../assets/img/center-bg.png);
			height: 2.38rem;
			opacity: 1;
			.bg();
			position: relative;

			.my-img {
				position: absolute;
				width: 0.46rem;
				height: 0.46rem;
				background-image: url(../../assets/img/touxiang.png);
				.bg();
				top: 0.68rem;
				left: 0.28rem;
			}

			.name {
				font-size: 0.16rem;
				font-weight: bold;
				color: #FFFCFC;
				opacity: 1;
				position: absolute;
				top: 0.70rem;
				left: 0.94rem;
			}

			.tip-img {
				display: inline-block;
				width: 0.58rem;
				height: 0.22rem;
				position: absolute;
				top: 0.94rem;
				left: 0.94rem;
				background-image: url(../../assets/img/center-tip.png);
				.bg();
			}

			.set-img {
				display: inline-block;
				width: 0.32rem;
				height: 0.32rem;
				position: absolute;
				top: 0.61rem;
				left: 3.25rem;
				background-image: url(../../assets/img/set-img.png);
				.bg();
			}

			.centerList {
				display: flex;
				position: absolute;
				top: 1.34rem;
				left: 0.06rem;

				li {
					display: flex;
					flex-direction: column;
					margin-left: 0.36rem;

					.count {
						font-size: 0.18rem;
						font-weight: 800;
						color: #FFFCFC;
						opacity: 1;
					}

					.leixing {
						font-size: 0.12rem;
						color: #FFFCFC;
						opacity: 1;
					}
				}
			}

			.vip {
				position: absolute;
				display: flex;
				width: 3.35rem;
				height: 0.4rem;
				background-image: url(../../assets/img/vip.png);
				.bg();
				bottom: 0;
				left: 0.2rem;

				input {
					font-size: 0.12rem;
					color: #333333;
					opacity: 1;
					width: 0.64rem;
					height: 0.24rem;
					background: #F4D4AC;
					opacity: 1;
					border-radius: 0.11rem;
					border: none;
					margin: 0.08rem 0 0 2.49rem;
				}
			}

		}

		.contentBox {
			margin: 0.08rem 0.12rem 0 0.12rem;

			.commonhead {
				display: flex;
				margin-left: 0.2rem;
				margin-right: 0.12rem;
				padding-bottom: 0.08rem;
				border-bottom: 0.01rem solid #F2F2F2;
				;

				.commonText {
					font-size: 0.14rem;
					font-weight: bold;
					color: #333333;
					margin-top: 0.13rem;
				}

				.lookall {
					font-size: 0.12rem;
					color: #999999;
					opacity: 1;
					margin-left: 1.95rem;
					margin-top: 0.14rem;
				}

				.rightImg {
					display: inline-block;
					width: 0.20rem;
					height: 0.20rem;
					margin-top: 0.12rem;
					background-image: url(../../assets/img/right-icon.png);
					.bg();
				}
			}

			.order {
				background: #FFFFFF;

				.orderList {
					display: flex;
					margin-top: 0.14rem;

					li:nth-child(1) {
						margin-left: 0.24rem;
					}

					li {
						display: flex;
						flex-direction: column;
						text-align: center;
						margin-left: 0.51rem;

						.pay {
							.orderImg();
							background-image: url(../../assets/img/present.png);
							.bg();
						}

						.receiving {
							.orderImg();
							background-image: url(../../assets/img/present.png);
							.bg();
						}

						.evaluate {
							.orderImg();
							background-image: url(../../assets/img/present.png);
							.bg();
						}

						.sales {
							.orderImg();
							background-image: url(../../assets/img/present.png);
							.bg();
						}

						.text {
							font-size: 0.10rem;
							color: #333333;
							opacity: 1;
							margin-bottom: 0.12rem;
						}
					}
				}
			}

			.banner {
				width: 3.5rem;
				height: 0.78rem;
				margin-top: 0.12rem;
				background-image: url(../../assets/img/center-banner.png);
				.bg();
			}

			.service {
				background: #FFFFFF;

				.serviceList {
					display: flex;
					flex-wrap: wrap;
					margin-top: 0.03rem;
					padding-bottom: 0.18rem;

					li {
						display: flex;
						flex-direction: column;
						text-align: center;
						// margin-right: 0.40rem;
						margin-left: 0.34rem;
						margin-top: 0.19rem;

						.address {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.money {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.myvip {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.chat {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.task {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.agreement {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.question {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.proposal {
							.orderImg();
							background-image: url(../../assets/img/shiping-center.png);
							.bg();
						}

						.text {
							font-size: 0.10rem;
							color: #333333;
							opacity: 1;
							margin-top: 0.09rem;
						}
					}
				}
			}
		}

		.like {
			display: flex;
			margin: 0.25rem 0 0 0.71rem;
			padding-bottom: 0.8rem;

			.img1 {
				width: 0.77rem;
				height: 0.106rem;
				background-image: url(../../assets/img/u-left.png);
				.bg();
			}

			.img2 {
				width: 0.77rem;
				height: 0.106rem;
				background-image: url(../../assets/img/u-right.png);
				.bg();
			}

			.text {
				font-size: 0.14rem;
				font-weight: bold;
				color: #C30D23;
				opacity: 1;
				margin: 0 0.12rem;
			}
		}
	}
</style>
